import React, {CSSProperties} from "react";
import {IconEnum} from "@/utils/IconEnum.ts";

interface IIconFontProps {
  icon?: string,
  style?: CSSProperties
  size?: number
  color?: string
}

const IconFont: React.FC<IIconFontProps> = ({icon, style, size, color}) => {

  const styleProps: CSSProperties = {
    fontSize: size,
    color
  }

  return (
    <>
      {
        icon ? <span className={`iconfont ${icon}`} style={{...styleProps, ...style}}></span> :
          <span className={`iconfont ${IconEnum.NULL}`} style={{...style, ...styleProps}}></span>
      }
    </>
  )
}

export default IconFont